package com.spzx.product.api;

import com.spzx.common.core.constant.SecurityConstants;
import com.spzx.common.core.constant.ServiceNameConstants;
import com.spzx.common.core.domain.R;
import com.spzx.product.api.domain.CategoryVo;
import com.spzx.product.api.factory.RemoteCategoryFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;

import javax.management.relation.RoleList;
import java.util.List;

/**
 * ClassName: RemoteCategoryService
 * Package: com.spzx.product.api
 * Description:
 *
 * @Author ycy
 * @Create 2024/8/9 15:44
 * @Version 1.0
 */

/**
 * 文件服务
 */
@FeignClient(contextId = "remoteCategoryService", value = ServiceNameConstants.PRODUCT_SERVICE, fallbackFactory = RemoteCategoryFallbackFactory.class)
public interface RemoteCategoryService {

    @GetMapping(value = "/category/getOneCategory")
    public R<List<CategoryVo>> getOneCategory(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping(value = "/category/tree")
    public R<List<CategoryVo>> tree(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);


}
